<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加/修改消息</title>
<%@ include file="/view/common/tags.jsp"%>
	<link rel="stylesheet" href="${sysManagerV1}/js/kindeditor/themes/default/default.css" type="text/css"/>
    <script type="text/javascript" charset="UTF-8" src="${sysManagerV1}/js/kindeditor/kindeditor-min.js"></script>
	<script type="text/javascript" charset="gbk" src="${sysManagerV1}/js/kindeditor/lang/zh_CN.js"></script>
</head>
<body>
	<div class="well well_p" >
		<sk:form method="post" cssClass="form-horizontal" action="" id="saveAndUpdateFrom" target="_parent"  enctype="multipart/form-data">
			<c:if test="${flag == 0}">
				<div class="form-group">
					<label class="col-xs-2 text-right">排序编号：</label>
					<div class="col-xs-4">
						<input type="text" class="form-control" name="orderNum" id="orderNum" value="${ordernumflag}"  placeholder="请输入排序编号">
					</div>
				</div>
			</c:if>
			<c:if test="${flag == 1}">
				<div class="form-group">
					<label class="col-xs-2 text-right">排序编号：</label>
					<div class="col-xs-4">
						<input type="text" class="form-control" name="orderNum" id="orderNum" value="${tlzsMessage.orderNum}"  placeholder="请输入排序编号">
					</div>
				</div>
			</c:if>
			<div class="form-group" >
				<label class="col-xs-2 text-right">消息标题：</label>
				<div class="col-xs-7">
					<input type="text" class="form-control" name="messageTitle" id="messageTitle" value="${tlzsMessage.messageTitle}"  placeholder="输入消息标题" onblur="checkLength()">
				</div>
			</div>
			<div class="form-group">
					<label class="col-xs-2 text-right" >应用名称：</label>
		            <div class="col-xs-4 ">
			            <sk:select cssClass="form-control select" name="gameName" id="gameName" value="${checkGameName}" >
							<option value="all" >全部</option>
							<sk:options  options="${appNameList}" ></sk:options> 
						</sk:select>
		            </div>
	            </div>
	            <div class="form-group">
					<label class="col-xs-2 text-right" >设备：</label>
		            <div class="col-xs-4 ">
			            <select class="form-control select" name="gameId" id="gameId" >
							<option value="0" ${phoneId==0 ? 'selected="selected"' : '' }>全部</option>
							<option value="20" ${phoneId==20 ? 'selected="selected"' : '' }>Android</option>
							<option value="10" ${phoneId==10 ? 'selected="selected"' : '' }>IOS</option>
						</select>
		            </div>
	            </div>
			<c:if test="${flag == 0}">
				<div class="form-group" >
					<label class="col-xs-2 text-right">是否发布：</label>
					<div class="col-xs-4">
						<td colspan="2">
		                   	<label for="port"><input id="port" name="useFlag" type="radio"  value="1"/>&nbsp;是</label>&nbsp;&nbsp;&nbsp;&nbsp;
		                   	<label for="no"><input id="no" name="useFlag" type="radio" checked="checked" value="0"/>&nbsp;否</label>
		               	</td>
					</div>
				</div>
			</c:if>
			<c:if test="${flag == 1}">
				<div class="form-group" >
					<label class="col-xs-2 text-right">是否发布：</label>
					<c:if test="${tlzsMessage.useFlag == 1}">
						<div class="col-xs-7">
							<td colspan="2">
			                   	<label for="port1"><input id="port1" name="useFlag" type="radio" checked="checked"  value="1"/>&nbsp;是</label>&nbsp;&nbsp;&nbsp;&nbsp;
			                   	<label for="no1"><input id="no1" name="useFlag" type="radio"  value="0"/>&nbsp;否</label>
			               	</td>
						</div>
					</c:if>
					<c:if test="${tlzsMessage.useFlag == 0}">
						<div class="col-xs-7">
							<td colspan="2">
			                   	<label for="port1"><input id="port1" name="useFlag" type="radio"  value="1"/>&nbsp;是</label>&nbsp;&nbsp;&nbsp;&nbsp;
			                   	<label for="no1"><input id="no1" name="useFlag" type="radio" checked="checked" value="0"/>&nbsp;否</label>
			               	</td>
						</div>
					</c:if>
				</div>
			</c:if>
			<div class="form-group" >
				<label class="col-xs-2 text-right">图片：</label>
				<div class="col-xs-10">
				<div class="cb_box cbx_img_bg">
	        		<c:if test="${not empty tlzsMessage.messageImgPath}">
		    			<img id="newmainImgPath" src="${pic}${tlzsMessage.messageImgPath}" width="160px;" height="118px;" onerror="javascript:this.src='${sysManagerV1}/images/uploadImage/noimage.gif';">
			    	</c:if>
				    <c:if test="${empty tlzsMessage.messageImgPath}">
				    	<img id="newmainImgPath" src="" width="160px;" height="118px;" onerror="javascript:this.src='${sysManagerV1}/images/uploadImage/noimage.gif';">
				    </c:if>
		        	<br/>
		        	<div class="mainImgPathBox">
		        		<a href="javascript:;" class="file">选择文件<input id="imgPath"  type="file" name="imgPath" class="input160"  onchange="newPic(this,'mainImgPath');"/></a>		        		
		        	</div>
		        	<div class="exp_box" style="color:red;">建议尺寸为320*120px(jpeg、jpg、bmp、gif、png)，不能选中大于500KB的图片。</div>
               	</div>
               	</div>
			</div>
			<div class="form-group">
				<label class="col-xs-2 text-right">消息内容：</label>
				<div class="col-xs-10" >
					<textarea id="messageContent" name="content" style="width:450px;height:310px;border:#ccc solid 1px;text-indent:3px;padding-top:3px;"/>${tlzsMessage.content}</textarea>
				</div>
			</div>
			<input type="hidden" id="rowId" name="rowId" value="${tlzsMessage.rowId}">
           	<input type="hidden" id="messageImgPath" name="messageImgPath" value="${tlzsMessage.messageImgPath}">
           	<input type="hidden" id="flag"  value="${flag}">
           	<input type="hidden" id="isReCommit" value="0">
		</sk:form>	
	</div>
</body>
<%@ include file="/view/common/footer.jsp"%>
<script type="text/javascript" src="${sysManagerV1}/view/js/system/message_add.js"></script>
</html>